Object model technology is becoming more popular for building enterprise applications. However, many organizations have already developed non-object oriented data storage systems and have their corporate data stored in those databases. Accordingly, it is desirable to provide a mechanism to allow object oriented applications to manipulate data in non-object oriented databases, such as relational databases (i.e., write, read, delete and update data in or from the databases as application objects). Object-oriented applications are built using object models with inheritance and relationships, whereas relational databases consist of flat tables and foreign keys. It is desirable to be able to represent the raw database data as application objects.
Databases are queried through a database query language, such as Structured Query Language (SQL), however it is desirable to query objects at the object level and through traversing the object model. To do so effectively, the relationships among objects need to be considered.
In an object model, some objects may reference other objects. When an object referenced by an other object has a reference back to the first object, these objects are related through a bi-directional relationship. When a user changes a reference in one object to another object, the relationship needs to be modified accordingly to maintain the bi-directional relationships among the related objects.
In existing systems, it is the user's responsibility to maintain these relationships. The user may need to develop code to modify references in objects one by one each time when a reference is changed. This is time and labor consuming and may involve errors. This prior solution results in added code maintenance by client developers. Also, this prior solution increases the chances of developer-created code error.
Accordingly, it is desirable to provide users with an automated means of maintaining bi-directional relationships among objects in an object model.